<script setup>
import NavBar from './components/NavBar.vue';
import FooterRecord from './components/FooterRecord.vue';
import { onMounted } from 'vue';

const current_path = window.location.pathname;

onMounted(() => {
  const theme = localStorage.getItem('theme')
  if (theme === 'dark') {
    document.documentElement.classList.add('dark-theme')
  } else {
    document.documentElement.classList.remove('dark-theme')
  }
})
</script>

<template>
  <div style="display: flex; flex-direction: column; min-height: 100vh;">
    <!-- 当login页面不显示NavBar -->
    <div v-if="current_path !== '/login'">
      <NavBar />
    </div>
    <router-view style="flex: 1;"></router-view>
    <!-- 所有页面都显示备案信息 -->
    <FooterRecord />
  </div>
</template>

<style>
#app{
    width: 100%;
    height: 100%;
    overflow: hidden;
}
body{
    margin: 0;
    padding: 0;
}
</style>